using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace SunshineFarmWord
{
    public class PlayerCaughtState : PlayerFishingBaseState
    {
        public PlayerCaughtState(PlayerStateMachine playerStateMachine) : base(playerStateMachine)
        {
        }

        #region base function
        public override void Enter()
        {
            base.Enter();

            InitCaughtReusableData();

            StartAnimation(stateMachine.Player.AnimationData.CaughtParameterHash);
        }

        public override void Exit()
        {
            base.Exit();

            StopAnimation(stateMachine.Player.AnimationData.CaughtParameterHash);
        }

        public override void OnAnimationExitEvent()
        {
            base.OnAnimationExitEvent();
            //
            if (stateMachine.ReusableData.PlayerStatesData.PlayerFishingData.IsFishingSustain)
            {
                stateMachine.ChangeState(stateMachine.CastingState);
            }
            else
            {
                stateMachine.ChangeState(stateMachine.IdlingState);
            }

        }
        #endregion
    }
}
